package com.cqh.recruit.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cqh.recruit.pojo.dto.StudentLoginDTO;
import com.cqh.recruit.pojo.dto.StudentQueryDto;
import com.cqh.recruit.pojo.entity.Student;
import com.cqh.recruit.pojo.vo.StudentListVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 学生信息表 Mapper 接口
 * </p>
 *
 * @author dh
 * @since 2025-10-18
 */
public interface StudentMapper extends BaseMapper<Student> {

    /**
     * 学生登录,通过账号和密码查询
     * @param studentLoginDto
     * @return
     */
    @Select("select * from student where account=#{studentLoginDto.account} and password=#{studentLoginDto.password}")
    Student login(@Param("studentLoginDto") StudentLoginDTO studentLoginDto);

    /**
     * 通过账号 、姓名查询
     * @param studentQueryDto
     * @return
     */
    Page<StudentListVo> findStudentByQueryDto(Page  page, @Param("student") StudentQueryDto studentQueryDto);
}